package com.dubbo.cp.payment.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dubbo.cp.payment.entity.Wallet;

@Mapper
public interface WalletMapper extends BaseMapper<Wallet>{
	/**
	 * 
	 * @param price
	 * @return
	 */
	@Update("update wallet set balance=balance-#{price} where username=#{username}")
	int decreaseBalanceBy(@Param("username")String username,@Param("price")double price);
}
